# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from twisted.enterprise import adbapi
import MySQLdb
import MySQLdb.cursors

class FinancePipeline(object):
    def process_item(self, item, spider):
        conn=MySQLdb.connect(host="192.168.0.59",user="root",passwd="123123",db="test",charset="utf8")
        cursor = conn.cursor()
        cursor.execute("insert into finance_sina(plate_name,com_num) values('%s','%s')" % (item['plate_name'], item['com_num']))
        conn.commit()
        return item
